/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rie06.openvoip.client.IHM.communication;

import com.rie06.openvoip.client.Conversation;
import com.rie06.openvoip.client.IHM.home.InterfaceClient;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import org.apache.log4j.Logger;

/**
 *
 * @author Sylvain
 */
public class WindowDialog extends JFrame{
    
    private InterfaceClient interfaceClient;
    private PanelOption panelOption;
    private PanelMessage panelMessage;
    private PanelDialog panelDialog;
    private PanelContactConversation panelContactConversation;
    private static final Logger logger = Logger.getLogger(WindowDialog.class);
    
    private Conversation conversation;
    
    
    private CommunicationController communicationController;
    
    public WindowDialog(CommunicationController communicationController, Conversation conversation, boolean visible){

        communicationController.getInterfaceClient().getConversationWindowList().put(conversation.getUuid(), this);
        
        this.setTitle("Communication");
        this.conversation = conversation;
        this.communicationController = communicationController;
        this.communicationController.setDialogWindow(this);
        this.setSize(700, 700);
        this.setLocationByPlatform(true);
        this.setLocation(800, 100);
        this.setVisible(visible);
        this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        this.setResizable(false);
        
        panelOption = new PanelOption(this, this.communicationController);  
        panelDialog = new PanelDialog(this, this.communicationController);
        panelMessage = new PanelMessage(this, this.communicationController, conversation);
        
        // ********************* DISPLAY *********************/
		BorderLayout styleFenetre = new BorderLayout();
		this.getContentPane().setLayout(styleFenetre);
                this.getContentPane().add(panelOption, BorderLayout.NORTH);
                this.getContentPane().add(panelDialog, BorderLayout.WEST);
                this.getContentPane().add(panelMessage, BorderLayout.EAST);
        // *************************************************/
           
    }

    public CommunicationController getCommunicationController() {
        return communicationController;
    }

    public void setCommunicationController(CommunicationController communicationController) {
        this.communicationController = communicationController;
    }

    public InterfaceClient getInterfaceClient() {
        return interfaceClient;
    }

    public void setInterfaceClient(InterfaceClient interfaceClient) {
        this.interfaceClient = interfaceClient;
    }

    public PanelDialog getPanelDialog() {
        return panelDialog;
    }

    public void setPanelDialog(PanelDialog panelDialog) {
        this.panelDialog = panelDialog;
    }

    public PanelMessage getPanelMessage() {
        return panelMessage;
    }

    public void setPanelMessage(PanelMessage panelMessage) {
        this.panelMessage = panelMessage;
    }

    public PanelOption getPanelOption() {
        return panelOption;
    }

    public void setPanelOption(PanelOption panelOption) {
        this.panelOption = panelOption;
    }

    public Conversation getConversation() {
        return conversation;
    }

    public void setConversation(Conversation conversation) {
        this.conversation = conversation;
    }
    
}
